import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 洪汤泽大帅哥
 * Date: 2024-10-12
 * Time: 13:43
 */
//求斐波那契数列的第n项。(迭代实现)
public class TestDemo {

    public static int fib2(int n) {
        if(n==1||n==2){
            return 1;
        }
        int f1 = 1;
        int f2 = 1;
        int f3 = -1;
        while (n >= 3) {
            f3 = f1 + f2;
            f1 = f2;
            f2 = f3;
            n--;
        }
        return f3;
    }

    public static int fib1(int n) {
        if (n == 1 || n == 2) {
            return 1;
        } else {
            return fib1(n - 2) + fib1(n - 1);
        }
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        System.out.println(fib1(n));
        System.out.println(fib2(n));
    }
}
